﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FluentNHibernate.Mapping;
using nsadv.Statistic.Domain;

namespace nsadv.Statistic.Repository.NHibernate.Config.Maps
{
	class StatisticItemMap : ClassMap<StatisticItem>
	{
		public StatisticItemMap()
		{
			Not.LazyLoad();
			Table("Stats");
			Id(x => x.Id)
				.Length(50)
				.GeneratedBy.Custom<Utils.IdentifierGenerator>();
			Map(x => x.DeviceId);
			Map(x => x.DeviceLanguge);
			Map(x => x.DeviceOS);
			Map(x => x.DeviceType);

			Map(x => x.EventDate);
			Map(x => x.EventId);
			Map(x => x.Hash);
			Map(x => x.ClientName);
			Map(x => x.Count);

			References(x => x.Banner)
				.Column("BannerId");
			References(x => x.Place)
				.Column("PlaceId");
			References(x => x.Platform)
				.Column("PlatformId");
		}
	}
}
